package Io;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class Copy_char {
    public static void main(String[] args) {
        FileReader reader=null;
        FileWriter writer=null;
        try {
            reader =new FileReader("Node.TXT");
            writer =new FileWriter("D:\\Node.TXT");
            char[] chars=new char[2];
            int readCount=0;
            while((readCount=reader.read(chars))!=-1){
                writer.write(chars,0,readCount);
            }
            writer.flush();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                reader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
            try {
                writer.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }


    }
}
